<?php
/* -=-=-=-=-=-=-=-=-=-=-=-=-
     author by terry
-=-=-=-=-=-=-=-=-=-=-=-=- */
error_reporting(7);
require "global.php";
cpheader();
//set offset
if(!empty($_POST[offset]))
{$offset = $_POST[offset];}
else if  (!empty($_GET[offset]))
{$offset = $_GET[offset]; }
else  {$offset = 0; }
include("../FCKeditor/fckeditor.php") ;

$arr = array("7"=>"Global Help","3"=>"Recruiter Help" ,"4"=>"Employer Help","5"=>"Candidate Help","6"=>"Advisor Help","9"=>"Recruiter Page","10"=> "Employer Page","11"=>"Candidate Page","12"=>"Advisor Page");

	?>
     <?      
	 		$cpforms->formheader(array('title'=>$arr[$_GET[id]].' (<font color=red>*</font>=Required Field)',
										'name'=>'article'));
			$cpforms->makehidden(array('name'=>'action',
									   'value'=>'update'));
		   $cpforms->makehidden(array('name'=>'id',
									   'value'=>$_GET[id]));
	       $rs  = $DB->fetch_one_array("SELECT * FROM ".$db_prefix."announce WHERE an_id = '".$_GET[id]."'");   
		   $cpforms->makefck(array('text'=>"Content",'name'=>"content",'value'=>"$rs[an_content]",'view'=>"$view",'width'=>'600','height'=>'600'));

	 ?>

<?

   if($_GET[action]=="view"){$cpforms->noformfooter();}
	   else{ $cpforms->formfooter(array('confirm'=>1));}


if ($_POST[action]=="update"){
	$content =  trim($_POST[content]);
    $sql = "UPDATE ".$db_prefix."announce SET `an_content` = '".$content."' WHERE an_id='".$_POST[id]."'";

	$DB->query($sql);

    redirect("./help.php?id=".$_POST[id],"<font color=red>Modified Successfully!</font>");
}
cpfooter();
?>